
import axios from "axios";

const service = axios.create({
    baseURL: 'https://api.imooc-web.lgdsunday.club/api',
    timeout: 500000,
    headers: {
        'Content-Type': 'application/json;charset=utf-8'
    }
})

service.interceptors.request.use(config => {
    // config.headers.icode = 'input you icode'
    return config
})

service.interceptors.response.use(async res => {
    return Promise.resolve(res.data)
}, error => {
    console.log(`output->error`, error)
    return Promise.reject(error)
})

// 通用下载方法
export default service